@extends('content.layouts.default')
@section('content')
{{--    @dd($models)--}}
    <div class="card">
        <div class="card-body">
            <ul class="nav nav-tabs nav-overflow header-tabs">
                <li class="nav-item">
                    <a href="{{route('content.category.index')}}" class="nav-link pb-3 ">
                        栏目列表
                    </a>
                </li>
                <li class="nav-item">
                    <a href="{{route('content.category.create')}}" class="nav-link pb-3 active">
                        发表栏目
                    </a>
                </li>
            </ul>
        </div>
        <form action="{{route('content.category.store')}}" method="post">
            @csrf
            <div class="card-body">
                <div class="card">
                    <div class="card-header">
                        基本设置
                    </div>
                    <div class="card-body">
                        <div class="form-group">
                            <label>栏目名称</label>
                            <input type="text" name="title"  required class="form-control" placeholder="" aria-describedby="helpId">
                            <div class="form-group">
                                <label>栏目模型</label>
                                <select name="content_model_id" class="form-control">
                                @foreach($models as $model)
                                        <option value="{{$model['id']}}">{{$model['title']}}</option>
                                    @endforeach
                                </select>
                            </div>
                        <div class="form-group">
                            <label>父级栏目</label>
                            <select name="parent_id" class="form-control">
                                @foreach($categorys as $v)
                                <option value="{{$v['id']}}">{{$v['_title']}}</option>
                                    @endforeach
                            </select>
                        </div>
                        <div class="form-group">
                            <label>栏目描述</label>
                            <textarea name="describe" class="form-control"  rows="3"></textarea>
                        </div>
                        <div class="form-group">
                            <label>封面栏目</label>
                            <div class="form-check form-check-inline">
                                <input class="form-check-input" type="radio" name="is_home" id="inlineRadio1" value="1">
                                <label class="form-check-label"  for="inlineRadio1">是</label>
                            </div>
                            <div class="form-check form-check-inline">
                                <input class="form-check-input"  type="radio" name="is_home" id="inlineRadio1" value="0" checked>
                                <label class="form-check-label" for="inlineRadio1">否</label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="card">
                    <div class="card-header">
                        模板设置
                    </div>
                    <div class="card-body">
                        <div class="form-group">
                            <label>封面模板</label>
                            <input type="text" name="home_template" class="form-control" value="{{old('home_template','home.blade.php')}}">
                        </div>
                        <div class="form-group">
                            <label>列表页模板</label>
                            <input type="text" name="list_template" class="form-control" value="{{old('list_template','list.balde.php')}}">
                        </div>
                        <div class="form-group">
                            <label>文章内容页模板</label>
                            <input type="text" name="content_template" class="form-control" value="{{old('content_template','article.blade.php')}}">
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-footer text-muted">
                <button class="btn btn-primary btn-sm">保存提交</button>
            </div>
        </form>
    </div>
@endsection